package com.serial.comm.modular.serialPort.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;

import java.io.Serializable;

/**
 * <p>
 * 原始电报信息表
 * </p>
 *
 * @author chentl123
 * @since 2020-02-21
 */
@TableName("wh_serial_origin")
public class Origin extends Model<Origin> {

    private static final long serialVersionUID = 1L;

    public Origin() {
    }

    /**
     * 用于新建电报元数据 的构造
     *
     * @param content
     * @param success
     * @param type
     * @param guid
     */
    public Origin(String content, Integer success, Integer type,String guid) {
        this.content = content;
        this.success = success;
        this.type = type;
        this.guid = guid;
    }

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 完整电报内容
     */
    private String content;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 完整电报信息处理是否成功 |  0 失败 1 成功
     */
    private Integer success;
    /**
     * 原始电报 读写类型 |  0 读取  1  写入
     */
    private Integer type;
    /**
     * 报文唯一标识
     */
    private String guid;

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Integer getSuccess() {
        return success;
    }

    public void setSuccess(Integer success) {
        this.success = success;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Origin{" +
                "id=" + id +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                ", success=" + success +
                ", type=" + type +
                '}';
    }
}
